<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1 id="c">hello world</h1>
    <button onclick="changeText()">点击改变</button>
    <script>
        var text = "hello world"
        var textEle = document.getElementById("c")
        
        function changeText() {
            text = "world hello"
            console.log(text)
            textEle.innerHTML = text
        }
    </script>
</body>
</html>